The present invention relates to a robot controller for controlling the position and attitude of the hand of a robot holding a workpiece and, more particularly, to a robot controller adapted to have the workpiece machined by suitably moving it relative to a tool fixedly mounted on a tool bed.
FIG. 8 shows a conventional laser machining system that uses an articulated six-axis robot 30 (hereinafter called the robot). In the machining system, a workpiece W is fixedly mounted on a work bed 32 that remains stationary, with a tool T gripped by the hand of the robot 30. As the rotational amount of each controllable axes of the robot 30 changes under control, the position and attitude of the tool T are varied relative to the workpiece W. As a result, the workpiece W is cut along the path that was taught beforehand.
Under robot control, the position of the tool T is represented by a tool tip position vector whose components are indicated by a stationary coordinate system fixed to the shop floor. The attitude of the tool T is represented by a matrix of 3 rows and 3 columns (hereinafter called the attitude matrix). The attitude matrix is a representation of three mutually perpendicular unit vectors whose components are indicated by the stationary coordinate system fixed to the shop floor. The three unit vectors are provided in a rectangular coordinate system whose origin is fixed to the tip of the tool T. The position and attitude of the tool tip are represented together by a matrix of 4 rows and 4 columns using the above-described position vector and attitude matrix in homogeneous coordinates. (This 4-row, 4-column matrix representing the position and attitude of the tool tip in homogeneous coordinates is hereinafter called the position matrix.) The position matrix of the tool tip is expressed by a function that regards as a variable the rotation angle on each of the controllable axes of the robot. At a given point in time, the position matrix of the tool tip is obtained using the rotation angles on the controllable axes of the robot as it takes a particular position and attitude. Conversely, where the position matrix of the tool tip is known, the rotation angle on each of the controllable axes of the robot is determined as corresponding to that matrix.
The position and attitude of the tool T at any point on a machining path are taught beforehand using the position matrix of the tool tip described above. Between teaching points, interpolation calculations are made on the position and attitude of the tool tip so that the tool T moves along the path smoothly in terms of its position and attitude. The position matrix of the tool tip obtained from the interpolation is then subjected to inverse transformation. This yields a rotation angle on each of the controllable axes of the robot. With its axes controlled to attain the respective rotation angles, the robot follows the interpolated positions and attitudes as it moves on.
There is the so-called rotational axis method for making the interpolation calculations mentioned above. According to this method, changes in the attitude of the tool T between two given teaching points are represented by a rotating motion around a predetermined axis. That rotation angle around the axis which corresponds to the tool movement between the two points is split into as many divisions as the number of interpolation points. Each division is a unit rotation angle. The attitude of the tool at each interpolation point is obtained by rotating the tool from its first teaching point by a multiple of the unit rotation angle. The tool position is interpolated as follows. First, a displacement vector between teaching points is split into as many divisions as the number of interpolation points. Each division is the unit vector. A multiple of the unit vector is added to the position vector of the tool tip in effect at the first teaching point. This provides the position vector of the tool tip at each interpolation point.
There is then provided an operator by which to perform interpolation calculations on the position and attitude of the tool tip at the same time. The operator is an attitude transformation matrix of 4 rows and 4 columns, represented by homogeneous coordinates. Using the operator, the tool is rotated by a multiple of the unit rotation and is moved by a multiple of the unit vector. Namely, the attitude transformation matrix is applied to the position matrix of the teaching point which becomes a starting point between the two adjacent teaching points. This makes it possible to find the position matrix of the tool tip at each interpolation point.
Now, there may be cases where it is preferable to machine the workpiece by suitably moving it relative to the tool fixed on the tool bed, instead of the tool being moved onto the workpiece for machining. For example, the robot may grip the workpiece at a predetermined position, allow the workpiece to gain access to the tool, and machine the workpiece by moving it along a predetermined path relative to the tool. After machining, the robot may carry the workpiece to another predetermined position. According to this machining method, a single robot can take care of the entire series of workpiece-related actions, from loading to machining to unloading. An advantage of this method is a reduced machining time.
However, there are constraints on the above-described method. As shown in FIG. 9, where the workpiece is moved by the robot, lengths l.sub.1 and l.sub.2 between machining locations L.sub.1 and L.sub.2 on the one hand, and flange center 11 of the hand 40 of the robot 40 on the other, vary with changing machining locations. This means that the position matrix of a machining point on the workpiece W cannot be determined using rotation angles on the controllable axes of the robot. Where the workpiece W is gripped by the robot for machining, there is thus only one way to teach path point data: by use of the position matrix keyed to the flange center of the robot hand. The trouble is this: when the position and attitude of the flange center are changed at a constant velocity by making interpolation calculations under the rotational axis method on the position matrix of the flange center, the velocity at which the machining point moves relative to the tool T does not remain constant. In FIG. 9, for example, the machining velocity V at location L.sub.1 is higher than the machining velocity V' at location L.sub.2 when the workpiece is rotated around the flange center.
As describe above, in conventional setups where the workpiece W is held by the robot for machining, it is impossible to control the velocity of movement at the point of machining according to varying command values.
Therefore, in applications where sufficiently high levels of machining precision are obtained only if the machining velocity is made constant or is set to follow command values as they change, such as laser cutting, ark welding and deburring, it is necessary to program a large number of velocity change commands between movement commands so as to move the tool tip at a constant velocity relative to the workpiece. The problem with such arrangements is twofold: that the program to be entered by the worker becomes increasingly complicated, and that it is difficult to control the machining velocity with precision. For all the trouble taken, the accuracy of machining tends to deteriorate.